export default {
  namespaced: true,
  state: {
    slider: {
      opened: JSON.parse(sessionStorage.getItem("opened"))
    },
    menuList: null,
    navigation_tips_data: ["首页"]
  },
  mutations: {
    TOGGLE_SLIDER (state) {
      state.slider.opened = !state.slider.opened;
      sessionStorage.setItem("opened", JSON.stringify(state.slider.opened));
    },
    NAVIGATION_TIPS(state, navigation_tips_data) {
      state.navigation_tips_data = navigation_tips_data;
    },
    SET_MENU_LIST (state, menuList) {
      state.menuList = menuList;
    }
  },
  actions: {
    toggle_slider ({ commit }) {
      commit("TOGGLE_SLIDER");
    },
    navigation_tips({ commit }, navigation_tips_data) {
      commit("NAVIGATION_TIPS", navigation_tips_data);
    },
    set_menu_list ({ commit }, menuList) {
      commit("SET_MENU_LIST", menuList);
    }
  }
};
